﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Doctor.aspx.cs" Inherits="Physio_Clinic.WebForm4" %>
<%@ Register assembly="Devart.Data.Linq.Web, Version=3.1.34.0, Culture=neutral, PublicKeyToken=09af7300eec23701" namespace="Devart.Data.Linq.Web" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% if (currentUser != null && currentUser.Username == "admin")
       {   
      %>
    <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Large" 
    ForeColor="#99CCFF" Text="เเพทย์"></asp:Label>
<br __designer:mapid="113" />
<br __designer:mapid="10d" />
<asp:Button ID="Button1" runat="server" onclick="Button2_Click" Text="เพิ่ม" />
<asp:Button ID="Button2" runat="server" Enabled="False" onclick="Button3_Click" 
    Text="เเก้ไข" />
<asp:Button ID="Button3" runat="server" Enabled="False" onclick="Button1_Click" 
    Text="ลบ" />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
    BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" 
    CellSpacing="1" DataKeyNames="DoctorId" DataSourceID="DbLinqDataSource" 
    GridLines="None" onselectedindexchanged="GridView1_SelectedIndexChanged" 
    ShowHeaderWhenEmpty="True" Width="936px">
    <Columns>
        <asp:CommandField ShowSelectButton="True" SelectText="เลือก" 
            HeaderText="เลือก" />
        <asp:BoundField DataField="DoctorId" HeaderText="เลขที่" 
            InsertVisible="False" ReadOnly="True" SortExpression="DoctorId" />
        <asp:BoundField DataField="DoctorName" HeaderText="ชื่อเเพทย์" 
            SortExpression="DoctorName" >
        <HeaderStyle Width="150px" />
        </asp:BoundField>
        <asp:BoundField DataField="DoctorSurName" HeaderText="นามสกุล" 
            SortExpression="DoctorSurName" >
        <HeaderStyle Width="150px" />
        </asp:BoundField>
        <asp:BoundField DataField="Address" HeaderText="ที่อยู่" 
            SortExpression="Address" >
        <HeaderStyle Width="200px" />
        </asp:BoundField>
        <asp:BoundField DataField="Mobile" HeaderText="เบอร์ติดต่อ" 
            SortExpression="Mobile" >
        <HeaderStyle Width="100px" />
        </asp:BoundField>
        <asp:BoundField DataField="Email" HeaderText="อีเมล" SortExpression="Email" >
        <HeaderStyle Width="100px" />
        </asp:BoundField>
        <asp:BoundField DataField="WorkingDateString" HeaderText="วันทำงาน" 
            SortExpression="WorkingDateString" Visible="False">
        <HeaderStyle Width="60px" />
        <ItemStyle Width="20px" />
        </asp:BoundField>
        <asp:ImageField AlternateText="รูป" DataImageUrlField="ImageDoctor">
        </asp:ImageField>
    </Columns>
    <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
    <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
    <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#594B9C" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#33276A" />
</asp:GridView>
<cc1:DbLinqDataSource ID="DbLinqDataSource" runat="server" 
    ContextTypeName="Physio10Context.Physio10DataContext" EntityTypeName="" 
    TableName="Doctors">
</cc1:DbLinqDataSource>

    <% }
       else
       { %><asp:Label ID="ErrorText" runat="server" 
    Text="สิทธิหน้านี้สำหรับ ผู้ดูเเลระบบเท่านั้น " ForeColor="Red" 
        style="text-align: center"></asp:Label><asp:HyperLink ID="HyperLink1" 
    runat="server" NavigateUrl="http://physio10.com/" > click</asp:HyperLink><% } %>

</asp:Content>
